package com.woniu.service.impl;

import com.woniu.adapter.MaterialBomAdapter;
import com.woniu.outlet.po.MaterialBomPo;
import com.woniu.service.MaterialBomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class MaterialBomServiceImpl implements MaterialBomService {

    @Autowired
    private MaterialBomAdapter materialBomAdapter;

    @Override
    public List<MaterialBomPo> findMaterialBoms() throws Exception {
        List<MaterialBomPo> materialBomPos = materialBomAdapter.findMaterialBoms();
        return materialBomPos;
    }

    @Override
    public MaterialBomPo getMaterialBomById(Long id) throws Exception {
        return materialBomAdapter.getMaterialBomById(id);
    }

    @Override
    public MaterialBomPo getMaterialBomByMaterialCode(String materialCode) throws Exception  {
        return materialBomAdapter.getMaterialBomByMaterialCode(materialCode);
    }
}
